<template>

  <el-select v-model="sync_value" :disabled="disabled" placeholder="请选择仓库" filterable clearable>
    <el-option v-for="item in list" :key="item.stockId" :label="item.realName" :value="item.stockId" />
  </el-select>
</template>

<script>
import propsync from '@/mixins/propsync'
import { adminProvider } from '../../api/api'
export default {
  name: 'SelectStock',
  mixins: [propsync],
  props: {
    value: {
      default: '',
      isSync: true
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      list: []
    }
  },
  mounted() {
    adminProvider().listStock().then(data => {
      this.list = data.result
    })
  },
  methods: {
    // changeSelect(id) {
    //   const item = this.list.find(_ => _.id == id)
    //   this.$emit('selectChange', item)
    // }
  }
}
</script>

<style scoped>

</style>
